package reflect;

/**
 * 使用当前类测试反射机制
 */
@AutoRunClass
public class Person {
    private String name = "张三";
    private int age = 16;

    public Person(){

    }

    public Person(String name) {
        this.name = name;
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @AutoRun(3)
    public void sayHello(){
        System.out.println(name+":hello!");
    }
    public void sayHi(){
        System.out.println(name+":hi!");
    }

    @AutoRun
    public void sayGoodBye(){
        System.out.println(name+":goodbye!");
    }

    public void say(String info){
        System.out.println(name+":"+info);
    }
    public void say(String info,int count){
        for(int i=0;i<count;i++){
            System.out.println(name+":"+info);
        }
    }

    @AutoRun(1)
    private void dosome(){
        System.out.println("我是Person类的私有方法！！！！！");
    }


    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
